package com.tengju.motivation.infrastructure.persistence.mybatis.mapper;

import com.tengju.motivation.infrastructure.persistence.mybatis.dataobject.MotivationActivityTargetDetailDO;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;


public interface MotivationActivityTargetDetailMapper {

    int countTarget(@Param("activityId") long activityId);

    List<MotivationActivityTargetDetailDO> listTargets(@Param("activityId") long activityId);

    List<MotivationActivityTargetDetailDO> getActivityTargetDetailByIdAndTime(@Param("activityId") Long activityId,
                                                                              @Param("startTime") LocalDate startTime,
                                                                              @Param("endTime") LocalDate endTime);

    List<Long> getActivityIds(@Param("activityIds") List<Long> activityIds,
                             @Param("offset") int offset,
                             @Param("limit") int limit);

    int deleteByActivityId(@Param("activityId") long activityId);

    int batchInsert(@Param("list") List<MotivationActivityTargetDetailDO> detail);

    int update(@Param("detail") MotivationActivityTargetDetailDO detail);

    int countActivityId(@Param("activityIds") List<Long> activityIds);

    List<Long> listNoEndActivityIds(LocalDate activityEndDate);

    List<Long> listValidTimeActivityIds(LocalDate activityStartDate, LocalDate activityEndDate);

    void delete(@Param("list")List<Long> collect);
}
